<template>
  <form @submit="handleSubmit">
    <view class="myform">
      <input type="text" name="username" placeholder="请输入姓名" />
      <input type="text" name="userphone" placeholder="请输入手机" />
    </view>
    <button form-type="submit">确定录入</button>
  </form>
</template>

<script>
  export default {
    name: "",
    data() {
      return {
        requestdata:[]
      }
    },

    methods: {
      handleSubmit: function (e) {
        // console.log(e.target.value);
        var requestusername=e.target.value['username'];
        var requestuserphone=e.target.value['userphone'];
        // console.log(requestdata);
        const that = this;
        var api='https://eztw.com.cn/xcxpro_upimg?username='+ requestusername + '&userphone=' + requestuserphone;
        wx.request({
          url:api,
          data:{

          },
          header: {
            'content-type': 'application/json' // 默认值
          },
          success:function (res) {
           console.log(res.data)
          },
          fail:function (res) {
            console.log('接受失败')
          }
        })
      }
    },
    /*生命周期函数*/
    onShow() {
      // this.requestData()
    },

  }
</script>

<style scoped>

  .info {
    width: 90%;
    margin: 10px auto;
  }

  map {
    width: 100%;
    margin-bottom: 10px;
  }

  .userinfo .user_img {
    margin: 0 auto;
    width: 100px;
    display: block;
    height: 100px;
    border-radius: 50px;
  }

  .userinfo {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .userinfo-avatar {
    overflow: hidden;
    display: block;
    width: 160 rpx;
    height: 160 rpx;
    margin: 20 rpx;
    margin-top: 50 rpx;
    border-radius: 50%;
    border: 8px solid #fff;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
  }

  .userinfo {
    /* color: #fff; */
    font-size: 14px;
  }

  .box {
    width: 85%;
    margin: 30px auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, .2);
    -moz-box-shadow: 0 0 20px rgba(0, 0, 0, .2);
    -webkit-box-shadow: 0 0 20px rgba(0, 0, 0, .2);
  }

  .box .logo {
    padding: 5px 20px 5px;
    height: 40px;
  }

  .box .logoimg {
    width: 26px !important;
    float: left;
    margin-top: 5px;
  }

  .comname {
    float: left;
    color: #005bac;
    font-weight: bold;
    line-height: 40px;
  }

  .kefubutton {
    background: none;
    border: none;
    background: #005bac;
    padding-left: 0;
    padding-right: 0;
  }

  .kefubutton::after {
    border: none;
  }

  .color {
    padding: 5px 20px 5px;
    background: #005bac;
    color: #ffffff;
    border-radius: 0;
    margin-bottom: 2px;
    height: 40px;
    overflow: hidden;
  }

  .color .img {
    width: 20px !important;
    float: left;
    margin-top: 10px;
  }

  .color .tit {
    float: left;
    font-size: 14px;
    color: #fff;
    font-weight: bold;
    margin-left: 5px;
    line-height: 40px;
  }

  .jishu {
    text-align: center;
    font-size: 14px;
    color: #5c5858;
  }
</style>
